/*
 ============================================================================
 Name        : PTA_basic.c
 Author      : gavin
 Version     :
 Copyright   : gavin@xjnu.edu.cn
 Description : Hello World in C, Ansi-style
 ============================================================================
 */

#include <stdio.h>
#include <stdlib.h>
//#include "include/1002.h"
#include "include/1002v2.h"
#include "include/common/common.h"

int main(void) {

//	printf("%d", cal_sum(98765));
	int sum = cal_sum(987655);
	int length = number_len(sum);
	int result[length];

	for (int i=0; i < length; i++) {
		result[i] = 0;
	}

	int *chars = number2chars(sum, result);

	for (int j=0; j < length; j++) {
		printf("%d", *(chars+j));
	}

	printf("%s\n", mapping_v2(chars, length));

	return EXIT_SUCCESS;
}
